<p>Since arrays do not override <code>Object.equals()</code>, calling equals on two arrays is the same as comparing their addresses. This means that <code>array1.equals(array2)</code> is equivalent to <code>array1==array2</code>. </p>
<p>However, some developers might expect <code>Array.equals(Object obj)</code> to do more than a simple memory address comparison, comparing for instance the size and content of the two arrays. To prevent such a misunderstanding, the '==' operator or <code>Arrays.equals(array1, array2)</code> must always be used in place of the <code>Array.equals(Object obj)</code> method.</p>
<h2>Noncompliant Code Example</h2>

<pre>
if(array1.equals(array2)){...}
</pre>
<h2>Compliant Solution</h2>

<pre>
if(Arrays.equals(array1, array2)){...}
</pre>
<p>or</p>
<pre>
if(array1 == array2){...}
</pre>

<h2>Deprecated</h2>
<p>This rule is deprecated, use {rule:squid:S2159} instead.</p>
